package com.demo.hotel_book.service;

import com.demo.hotel_book.dto.OrderDTO;
import com.demo.hotel_book.mapper.OrderZoneMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderZoneService {

    @Autowired
    OrderZoneMapper orderZoneMapper;

    public PageInfo<OrderDTO> getLogInfoPage(int pageNum, int pageSize, int user_id) {
        PageHelper.startPage(pageNum, pageSize);
        List<OrderDTO> list = orderZoneMapper.listOrdersByUser(user_id);
        //System.out.println(list);
        PageInfo<OrderDTO> pageInfo = new PageInfo(list);
        return pageInfo;
    }


}
